package com.myprocessing.box.button.group;

import java.util.List;

import com.myprocessing.box.button.Button;

public class GroupButtonManager {

	private List<GroupButton> buttons;

	public void onMousePress(Button button) {
		for (GroupButton groupButton : buttons) {
			if (!button.equals(groupButton)) {
				if(button instanceof RadioButton){
					((RadioButton)groupButton).deselect();
				} 
				groupButton.executeAction(groupButton.getAltButtonClick());
			}
		}
	}

	public List<GroupButton> getButtons() {
		return buttons;
	}

	public void setButtons(List<GroupButton> buttons) {
		this.buttons = buttons;
	}
}
